from django import forms


class UserLRForm(forms.Form):
    username = forms.CharField(
        # 提示信息
        label="用户名",
        min_length=2,
        max_length=10,
        error_messages={
            "min_length": "用户名长度小于2",
            "max_length": "用户名长度大于10"
        }
    )

    password = forms.CharField(
        # 提示信息
        # label="密码",
        min_length=6,
        max_length=20,
        error_messages={
            "min_length": "密码长度小于6",
            "max_length": "密码长度大于20"
        },
        # 修改为密码框类型
        widget=forms.PasswordInput
    )
